package com.yjd.pub.order.dao.impl;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.comm.merchant.dto.EverPurchaseProjectDto;
import com.yjd.comm.order.model.OrderProjectModel;
import com.yjd.pub.order.dao.IOrderProjectDao;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


/**
 * <b>description</b>：订单项目数据访问层 <br>
 * <b>time</b>：2017-06-27 08:54:10 <br>
 * <b>author</b>： yangchangyan@yijiedai.com
 */
@Component("orderProjectDao")
public class OrderProjectDaoImpl extends BaseDaoImpl implements IOrderProjectDao {

	private static final String SQLMAPNAMESPACE = OrderProjectModel.class.getName();
	private static final String PKNAME = "id";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public List<Long> queryProjectId(Map<String, Object> param) throws Exception {
		return this.getSqlMap(false).queryForList(
				this.getStatement("queryProjectId"), param);
	}

	@Override
	public List<EverPurchaseProjectDto> everPurchaseProject(Map<String, Object> param) throws Exception {
		return this.getSqlMap(false).queryForList(this.getStatement("queryEverPurchaseProject"), param);
	}
}
